package edu.bjfu.klotski.BLL;

import edu.bjfu.klotski.R;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsoluteLayout;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class LevelAdapter extends BaseAdapter{

	private String[] mTextValues = {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"};
	private Context mContext;
	
	public LevelAdapter(Context c){
        mContext = c;
    }
	public int getCount() {
		// TODO Auto-generated method stub
		return mTextValues.length;
	}

	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		View view = View.inflate(mContext, R.layout.level_item, null);
		AbsoluteLayout al = (AbsoluteLayout) view.findViewById(R.id.al_level_item);
		ImageView image = (ImageView) al.findViewById(R.id.iv_lock);
		TextView text = (TextView) al.findViewById(R.id.tv_level_number);
		//image.setImageResource(mThumbIds[position]);
		text.setText(mTextValues[position]);
		return al;
	}

}
